﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Jinjia.Approve.IRepository.JJFlow;
using Jinjia.Approve.IService.JJFlow.Approvers;

namespace Jinjia.Approve.Service.JJFlow.Approvers
{
    public class OakLogisticsPriceApprover : IJJApprovers
    {
        private readonly IJJApproversRepository _jjApproversRepository;

        public OakLogisticsPriceApprover(IJJApproversRepository jjApproversRepository)
        {
            _jjApproversRepository = jjApproversRepository;
        }

        public async Task<List<int>> GetInstanceNodeEmpInfo(string biz_order_id, int start_user = 0, string depart_id = "0", Dictionary<string, string> dic = null)
        {
            var user_id_list = new List<int>();
            var orgList = await _jjApproversRepository.OakLogisticsPriceApproverGetOrg(biz_order_id);
            if (orgList == null || orgList.Count <= 0)
            {
                throw new Exception("抱歉，未查询到可审批的人员，无法提交！");
            }
            else
            {
                user_id_list.AddRange(orgList);
            }

            return user_id_list;
        }
    }
}